// layui.define(['element'],function(exports){
//     var $ = layui.$;
//     $('.input-field').on('change',function(){
//         var $this = $(this),
//             value = $.trim($this.val()),
//             $parent = $this.parent();
//         if(value !== '' && !$parent.hasClass('field-focus')){
//             $parent.addClass('field-focus');
//         }else{
//             $parent.removeClass('field-focus');
//         }
//     })
//     exports('login');
//
//     $.post("http://localhost:8006/User/Userlogin",{"":},function(data)
// });


layui.use(['jquery','layer','form'], function() {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
    $.post("http://localhost:8037/xh",{},function(hm){
        console.log(hm.data)/*<input type="checkbox" name="like[write]" title="写作">*/

        var data = hm.data;

        var html="";
        for(var i =0;i<hm.data.length;i++){
            console.log(data[i].pnumber)
            html+='号码：'+data[i].pnumber+'<input id="pnumber" type="radio" name="sex" value="'+data[i].pnumber+'" title="" checked="">';
        }
        $("#xh").append(html);
    });



    $("#dl").click(function(){
        var setmealid = $("#setmealid").val();
        var idname= $("#idname").val();
        var identity= $("#identity").val();
        var  pnumber= $("#pnumber").val();
        alert(setmealid)
        alert(pnumber)
        var obj = {
            "setmealid":setmealid,
            "idname":idname,
            "identity":identity,
            "pnumber":pnumber,
        }


        $.post("http://localhost:8037/OpenAnAccount",obj,function(data){
            alert(data)
            if(data=="成功！"){
                window.location.href='login.html';
            }else {
                alert(data);
            }
        },"text");
     });
});
